home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / unixlib.lha / unix / intro.doc next >
Text File  |  1996-12-01  |  3KB  |  59 lines

  1. A quick guide to programs compiled with the unix library
  2. --------------------------------------------------------
  3.  
  4. If you are using programs compiled with my unix library, you should note
  5. the following points:
  6.  
  7. a) The following environment variables are taken into account by the unix
  8.    library, and therefore by any program compiled with it:
  9.  
  10.    USER     - A user name for the sole Amiga user (default "user").
  11.    USERNAME - The full name of the sole Amiga user (default $USER).
  12.    HOME     - A "home" directory (default "s:") for programs that want one.
  13.           Configuration files will probably end up here ...
  14.    SHELL    - A program which behaves reasonably like a Unix shell (default
  15.           "bin:sh"). You should copy the sh executable there if you don't
  16.           have a Unix-like shell.
  17.    HOSTNAME - The name of your machine (default "amiga").
  18.  
  19. b) Command line parsing is a mixture of AmigaDOS and Unix conventions (this
  20.    explanation assumes familiarity with Unix terminology ...) :
  21.  
  22.    - Arguments in single quotes (') are left as is.
  23.  
  24.    - Within arguments in double quotes ("), * acts as an escape character.
  25.      Arguments cotaining wildcards are expanded into several arguments (note
  26.      that this is a different from the Unix behaviour). ' must be used to
  27.      escape wildcards (this is the standard AmigaDOS convention).
  28.  
  29.    - Within unquoted arguments, \ acts as an escape character for wildcards,
  30.      spaces, etc. Arguments containing wildcards are expanded into several
  31.      arguments.
  32.  
  33.    As an example, assume that uecho is an unix-like echo command compiled with
  34.    the unix library, and that the current directory contains one file, echo.c.
  35.    Then
  36.  
  37.     uecho 'f*un\' "#?.c" "*.c" "\mad" \*.c \\ \n
  38.  
  39.    displays
  40.  
  41.     f*un\ echo.c .c \mad *.c \ n
  42.  
  43. c) Timezones. If you install the timezone information (provided with the
  44.    unix library), you must set your system clock to GMT. Otherwise the times
  45.    displayed or set by the unix library will be incorrect. To compensate, you
  46.    won't have to adjust your system clock for daylight savings time (the local
  47.    time calculated from GMT will always be correct).
  48.  
  49. d) Sockets. To use sockets you need AmiTCP and, assuming the include files are
  50.    in uinclude: and unix.lib in ulib:, should
  51.  
  52.    - compile with AMITCP defined (DEF=AMITCP)
  53.    - add netinclude: AFTER uinclude: in the include search path
  54.    - have an #include <proto/socket.h> in your code
  55.  
  56.    So the command to compile prog.c (containing socket calls) should be like
  57.  
  58.    sc link DEF=AMITCP idir=uinclude: idir=netinclude: lib=ulib:unix.lib prog.c
  59.